<?php defined('InNcPHP') or exit('Access Invalid!');?>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <h3><?php echo '活动内置链接'?></h3>
        </div>
    </div>
    <div class="fixed-empty"></div>
    <form method="post" enctype="multipart/form-data" name="form1"  id="form1">
        <input type="hidden" name="form_submit" value="ok" />
        <table class="table tb-type2">
            <tbody>
            <tr class="noborder">
                <td colspan="2" class="required"><label for="site_name"><?php echo '链接名称';?>:</label></td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input id="site_name" name="link_title" value="<?php echo $output['link_info']['link_title'];?>" class="txt" type="text" /></td>
                <td class="vatop tips"><span class="vatop rowform"><?php echo $lang['web_name_notice'];?></span></td>
            </tr>
            <tr>
                <td colspan="2" class="required"><label for="site_phone"><?php echo '链接地址';?>:</label></td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input id="site_phone" name="link_url" value="<?php echo $output['link_info']['link_url'];?>" class="txt" type="text" /></td>
                <td class="vatop tips"><span class="vatop rowform">链接前请加：‘http://’</span></td>
            </tr>


            </tbody>
            <tfoot id="submit-holder">
            <tr class="tfoot">
                <td colspan="2" ><a href="JavaScript:void(0);" class="btn"  id="submit_button"><span><?php echo $lang['nc_submit'];?></span></a></td>
            </tr>
            </tfoot>
        </table>
    </form>
</div>
<script type="text/javascript">


    $("#submit_button").click(function(){
       if( $("#form1").valid()){
           $("#form1").submit();
       }
    })
    $("#form1").validate({
     errorPlacement: function(error, element){
            if (element.attr('type') === 'file') {
              error.appendTo(element.parent().parent().parent().prev().find('td:first'));
            } else {
              error.appendTo(element.parent().parent().prev().find('td:first'));
            }
        },
        rules:{
            link_title:'required',
            link_url:'required',
        },
        messages:{
            link_title:'链接标题不能为空',
            link_url:'链接地址不能为空',
        },


    });
</script>
